package com.itheima.task;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.concurrent.TimeUnit;

/**
 * @author :WuJunJie
 * packageName :com.itheima.task
 * fileName :Task
 * creationTime :2022-12-05 9:39
 */
@Component
@Slf4j
public class Task {

    @Scheduled(fixedRate =1,timeUnit = TimeUnit.HOURS)
    public void task(){
        log.info("这是一个定时任务");
    }
}
